home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / CKT AGA 1.0 / LSeperator.cp < prev    next >
Encoding:
Text File  |  1996-05-09  |  1.0 KB  |  75 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        LSeperator.cp
  3.  
  4.     Contains:    Apple Grayscale Appearance-savvy 
  5.                 seperator line pane for PowerPlant.
  6.  
  7.     Copyright:    ©1996 Chris K. Thomas  All Rights Reserved.
  8.  
  9.     Version:    1.0
  10. */
  11.  
  12. #include "LSeperator.h"
  13. #include "AGAColors.h"
  14.  
  15. LSeperator*
  16. LSeperator::CreateSeperatorStream(LStream *inStream)
  17. {
  18.     return new LSeperator(inStream);
  19. }
  20.  
  21.  
  22. LSeperator::LSeperator()
  23. {
  24.  
  25. }
  26.  
  27.  
  28. LSeperator::LSeperator(LStream *inStream)
  29. :LPane(inStream)
  30. {
  31.     
  32. }
  33.  
  34.  
  35. LSeperator::~LSeperator()
  36. {
  37.  
  38. }
  39.  
  40.  
  41. void
  42. LSeperator::DrawSelf()
  43. {
  44.     SDimension16    size;
  45.     Rect            r;
  46.  
  47.     GetFrameSize(size);
  48.     CalcLocalFrameRect(r);
  49.     
  50.     //
  51.     // if taller rather than wider
  52.     //
  53.     if(size.height > size.width)
  54.     {
  55.         RGBForeColor(&kColor7);
  56.         MoveTo(r.left, r.top);
  57.         LineTo(r.left, r.bottom - 1);
  58.         
  59.         RGBForeColor(&kWhiteColor);
  60.         MoveTo(r.left + 1, r.top + 1);
  61.         LineTo(r.left + 1, r.bottom);
  62.     }
  63.     else
  64.     {
  65.         RGBForeColor(&kColor7);
  66.         MoveTo(r.left, r.top);
  67.         LineTo(r.right - 1, r.top);
  68.         
  69.         RGBForeColor(&kWhiteColor);
  70.         MoveTo(r.left + 1, r.top + 1);
  71.         LineTo(r.right, r.top + 1);
  72.     }
  73. }
  74.  
  75.